package com.finance_provider.controller;

import com.entity.BuyAdvance;
import com.finance_provider.service.BuyAdvanceService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: RinPromise
 * @Date: 2021/9/22 14:57
 */
@RestController
public class BuyAdvanceController {

    @Resource
    private BuyAdvanceService buyAdvanceService;

    @RequestMapping("/addBuyAdvance")
    Boolean addBuyAdvance(BuyAdvance buyAdvance){
        return buyAdvanceService.addBuyAdvance(buyAdvance);
    }

    @RequestMapping("/updateBuyAdvance")
    Boolean updateBuyAdvance(BuyAdvance buyAdvance){
        return buyAdvanceService.updateBuyAdvance(buyAdvance);
    }

    @RequestMapping("/queryBuyAdvance")
    List<BuyAdvance> queryBuyAdvance(BuyAdvance buyAdvance){
        return buyAdvanceService.queryBuyAdvance(buyAdvance);
    }

    @RequestMapping("/queryBuyAdvanceId/{id}")
    BuyAdvance queryBuyAdvanceId(@PathVariable("id") Long id){
        return buyAdvanceService.queryBuyAdvanceId(id);
    }

    @RequestMapping("/deleteBuyAdvanceId/{id}")
    Boolean deleteBuyAdvanceId(@PathVariable("id") Long id){
        return buyAdvanceService.deleteBuyAdvanceId(id);
    }

}
